<template>
  <div class="drug-prescription-table">
    <div class="table-title">成药处方一</div>
    <table>
      <thead>
        <tr >
          <th style="width: 48px" >序号</th>
          <th >药品</th>
          <th>用法</th>
          <th>备注</th>
          <th>总量</th>
          <th>已发</th>
          <th class="highlight">本次发</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item, idx) in list" :key="item.id || idx">
          <td style="text-align: center;"> {{ idx + 1 }}</td>
          <td>{{ item.name }}</td>
          <td>{{ item.usage }}</td>
          <td>{{ item.remark }}</td>
          <td>{{ item.total }}</td>
          <td>{{ item.sent }}</td>
          <td class="highlight_1">{{ item.current }}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script setup lang="ts">
defineProps<{
  list: Array<{
    id?: string | number;
    name: string;
    usage: string;
    remark: string;
    total: string;
    sent: string;
    current: string;
  }>;
}>();
</script>

<style scoped>
.drug-prescription-table {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px 0 #e9e9e9;
  margin: 0;
  overflow: hidden;
}
.table-title {
  font-size: 20px;
  font-weight: 500;
  color: #222;
  background: #f8f8f8;
  height: 52px;
  line-height: 52px;
  font-size: 14px;
  background: #f8f8f8;
  border-radius: 0px 0px 0px 0px;
  padding: 0px 17px;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 16px;
  color: #222;
}
th,
td {
  padding: 12px 8px;
  text-align: left;
  background: #fff;
}
th {
  color: #bdbdbd;
  font-weight: 400;
  font-size: 15px;
  background: #fff;
}
tr:not(:last-child) td {
  border-bottom: 1px solid #f0f0f0;
}
thead th { 
    border-bottom: 1px solid #f0f0f0;
      border-top: 1px solid #f0f0f0;
}
td.highlight,
th.highlight {
  color: #000000;
  font-weight: 500;
}
tr:last-child td {
  border-bottom: none;
}
.highlight_1{
font-size: 13px;
color: #16ADA4;
}
</style>
